#pragma once

#include "FXValue.h"
/**
* Wrapper around a single float.
* @author Koen Samyn
*/
class DAEFloat: public FXValue
{
public:
	/**
	* Creates a new DAE float object.
	*/
	DAEFloat();
	/**
	* Creates a DAE float object.
	* @param xValue the initial x value.
	*/
	DAEFloat(float xValue);
	/**
	* Clamps the values in this DAEFloat to a give range.
	* @param min the minimum allowable value.
	* @param max the maximum allowable value.
	*/
	void Clamp(float min, float max){
		if ( x > max) 
			x = max;
		else if ( x < min)
			x = min;
	}

	void Add(float value){
		x+= value;
	}
	/**
	* The wrapped float.
	*/ 
	float x;
	/**
	* Returns the size of the value in bytes.
	* @return the size in bytes.
	*/
	virtual int GetSizeInBytes() const{
		return sizeof(float);
	}
	/**
	* Returns the pointer to the beginning of the value.
	* @return a void pointer to the beginning of the value.
	*/
	virtual const void* GetValuePointer() const{
		return &x;
	}

private:
	// -------------------------
	// Disabling default copy constructor and default assignment operator.
	// If you get a linker error from one of these functions, your class is internally trying to use them. This is
	// an error in your class, these declarations are deliberately made without implementation because they should never be used.
	// -------------------------
	DAEFloat(const DAEFloat& t);
	DAEFloat& operator=(const DAEFloat& t);
};
